package com.itheima.string;

public class Demo1String {
    public static void main(String[] args) {
        String s = "abcde";
        int length = s.length();
        System.out.println("length = " + length);
        s = "fgh";//并未更改s的值只是修改了s记录的地址

        String s1 = new String();
        System.out.println("s1 = " + s1);

        char[] arr = {'a','b','c'};
        String s2 = new String(arr);
        System.out.println("s2 = " + s2);

        String s3 = new String("123");
        System.out.println("s3 = " + s3);

        byte[] arr1 = {97,98,99};
        String s4 = new String(arr1);
        System.out.println("s4 = " + s4);

        String s5 = "abc";
        System.out.println("s5 = " + s5);
    }
}
